package book;

public class BookList {
    private Book[] books;
    private int size;
    private int capacity;

    public BookList() {
        this.capacity = 3;
        books = new Book[this.capacity];
        books[0] = new Book("三国演义", "罗贯中", "小说", 20);
        books[1] = new Book("水浒传", "施耐庵", "小说", 25);
        books[2] = new Book("红楼梦", "曹雪芹", "小说", 10);
        this.size = 3;
    }


    public Book getBook(int pos){
        return books[pos];
    }

    public void setBook(int pos, Book book){
        books[pos] = book;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getCapacity() {
        return capacity;
    }

    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    public Book[] getBooks() {
        return books;
    }

    public void setBooks(Book[] books) {
        this.books = books;
    }
}
